package cn.ks.domain;

import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author zlj
 * @since 2022-11-18
 */
public class Purchase extends Model<Purchase> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    @TableField("goods_name")
    @NotEmpty(message = "商品名字不能为空")
    private String goodsName;
    @NotNull(message = "数量不能为空")
    private Long count;
    private Long examine;
    private Long state;
    @TableField("goods_id")
    @NotNull(message = "商品id")
    private Long goodsId;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public Long getCount() {
        return count;
    }

    public void setCount(Long count) {
        this.count = count;
    }

    public Long getExamine() {
        return examine;
    }

    public void setExamine(Long examine) {
        this.examine = examine;
    }

    public Long getState() {
        return state;
    }

    public void setState(Long state) {
        this.state = state;
    }

    public Long getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Long goodsId) {
        this.goodsId = goodsId;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "Purchase{" +
        ", id=" + id +
        ", goodsName=" + goodsName +
        ", count=" + count +
        ", examine=" + examine +
        ", state=" + state +
        ", goodsId=" + goodsId +
        "}";
    }
}
